<%--
  Created by IntelliJ IDEA.
  User: 金贤哲
  Date: 2017/6/20 0020
  Time: 15:02
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
    <title>信息</title>
    <meta name="decorator" content="default"/>
    <script src="${ctxStatic}/jquery/jquery-1.8.3.min.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(document).ready(function() {
            $('#btnSubmit').click(function () {
                var remarks = $('#remarks').val();
                var id = $(this).data("id");
                var list1={};
                list1["id"] = id;
                list1["remarks"] =remarks;
                document.getElementById("btnSubmit").style.display = "none";
                $.ajax({
                    type : "POST",  //提交方式
                    url : "${ctx}/sys/member/member/saveRemarks",//路径
                    data : list1,//数据，这里使用的是Json格式进行传输
                    success : function(data) {//返回数据根据结果进行相应的处理
                        console.log(data);
                        if(data){
                            layer.msg("客户交款信息保存成功！",{time:500},function(){
                                setTimeout(function () {
                                    window.location.reload();
                                },2000)
                            });
                        }
                       else {
                            layer.msg("提交失败！",{time:500},function(){
                                setTimeout(function () {
                                    window.location.reload();
                                },2000)
                            });
                        }
                    }
                });
            })
        })
    </script>
</head>
<body>
<div class="row" style="padding-left: 20px">
    <table id="contentTable" class="layui-table" style="margin-top: 10px;">
        <thead>
        <tr>
            <th style="width: 20%">姓名</th>
            <th style="width: 30%">${member.realname}</th>
        </tr>
        </thead>
        <tbody>
        <tr>
            <td colspan="2">客户收款信息：</td>
        </tr>
        <tr>
            <td colspan="2">
            <form:form id="inputForm" modelAttribute="member" class="form-horizontal">
                <form:textarea path="remarks" htmlEscape="false" rows="4" maxlength="590" id="remarks" class="input-xxlarge"/>
            </form:form>
                </td>
        </tr>
         <shiro:hasPermission name="sys:member:member:remarks"><tr>
            <td colspan="2"><input id="btnSubmit" class="btn btn-primary" type="submit" style="position: relative;left: 260px;"  data-id="${member.id}" value="保 存"/></td>
        </tr></shiro:hasPermission>
    </table>
</div>
</body>
</html>
